#if !defined(__EDGEDETECTION_H__)
#define __EDGEDETECTION_H__

#include "Metaballs2D.h"

namespace blobDetection
{

//==================================================
//class EdgeDetection
//==================================================
class EdgeDetection: public Metaballs2D
{
public:
	static unsigned char C_R;
	static unsigned char C_G;
	static unsigned char C_B;
	int 	imgWidth, imgHeight;
	int		*pixels;
	bool	posDiscrimination;
	int		bytesPerPixel;
	float	m_coeff;
	
//--------------------------------------------
// Constructor
//--------------------------------------------
	EdgeDetection(int imgWidth, int imgHeight,int bytesPerPixel);

//--------------------------------------------
// setPosDiscrimination()
//--------------------------------------------
	void setPosDiscrimination(bool is);
	
//--------------------------------------------
// setBytesPerPixel()
//--------------------------------------------
	void setBytesPerPixel(int bpp);

//--------------------------------------------
// setThreshold()
//--------------------------------------------
	void setThreshold(float value);

//--------------------------------------------
// setComponent()
//--------------------------------------------
/*
public void setComponent(byte flag)
{
	if (flag==0) flag = C_ALL;
	colorFlag = flag;
}
*/

//--------------------------------------------
// setImage()
//--------------------------------------------
	void setImage(int* pixels);
	
//--------------------------------------------
// computeEdges()
//--------------------------------------------
	void computeEdges(int* pixels);

//--------------------------------------------
// computeIsovalue()
//--------------------------------------------
	void computeIsovalue();

//--------------------------------------------
// getEdgeVertex()
//--------------------------------------------
	EdgeVertex getEdgeVertex(int index);

//--------------------------------------------
// getSquareIndex()
//--------------------------------------------
protected: 
	int getSquareIndex(int x, int y);

};

};

#endif